package com.navi.loaddata.core.gpEntity;

import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "wpp_sht_ope_conf", schema = "sor", catalog = "qmstst")
@IdClass(WppShtOpeConfPK.class)
public class WppShtOpeConf {
    private String opeId;
    private String valigFlg;
    private String targetSeq;
    private String evtUser;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp evtTimestamp;

    @Id
    @Column(name = "ope_id")
    public String getOpeId() {
        return opeId;
    }

    public void setOpeId(String opeId) {
        this.opeId = opeId;
    }

    @Id
    @Column(name = "valig_flg")
    public String getValigFlg() {
        return valigFlg;
    }

    public void setValigFlg(String valigFlg) {
        this.valigFlg = valigFlg;
    }

    @Basic
    @Column(name = "target_seq")
    public String getTargetSeq() {
        return targetSeq;
    }

    public void setTargetSeq(String targetSeq) {
        this.targetSeq = targetSeq;
    }

    @Basic
    @Column(name = "evt_user")
    public String getEvtUser() {
        return evtUser;
    }

    public void setEvtUser(String evtUser) {
        this.evtUser = evtUser;
    }

    @Basic
    @Column(name = "evt_timestamp")
    public Timestamp getEvtTimestamp() {
        return evtTimestamp;
    }

    public void setEvtTimestamp(Timestamp evtTimestamp) {
        this.evtTimestamp = evtTimestamp;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        WppShtOpeConf that = (WppShtOpeConf) o;
        return Objects.equals(opeId, that.opeId) &&
                Objects.equals(valigFlg, that.valigFlg) &&
                Objects.equals(targetSeq, that.targetSeq) &&
                Objects.equals(evtUser, that.evtUser) &&
                Objects.equals(evtTimestamp, that.evtTimestamp);
    }

    @Override
    public int hashCode() {

        return Objects.hash(opeId, valigFlg, targetSeq, evtUser, evtTimestamp);
    }
}
